package com.itheima.FileTest;

import java.io.File;

public class DeleteFile {
    public static void main(String[] args) {
        File src = new File("H:\\Java文件夹\\java项目工程\\myIdeaTest\\Module2\\aaa");
        deleteDir(src);
    }

    public static void deleteDir(File src) {
        File[] files = src.listFiles();

        for (File file : files) {
            if(file.isFile()){
                file.delete();
            }else{
                deleteDir(file);
            }
        }

        src.delete();
    }
}
